import requests as rq

base_url = 'https://search.sina.com.cn/?' #基础地址

headers={'user-agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36'}

key = 'lisxing' #指定搜索内容

params = {
    'q':key,
    'c':'news',
    'from':'channel',
    'ie':'utf-8'
}

response = rq.get(base_url,headers = headers,params=params)
with open('sina_news.html','w',encoding='utf-8') as fp:
    fp.write(response.content.decode('utf-8'))
print(response.status_code)
print(response.content)